
[dbo].[AppealParticipation]
CREATE TABLE [dbo].[AppealParticipation]
(
[AppealParticipationKey] [uniqueidentifier] NOT NULL,
[AppealKey] [uniqueidentifier] NOT NULL,
[RespondentUserKey] [uniqueidentifier] NOT NULL,
[SolicitationKey] [uniqueidentifier] NOT NULL,
[ResponseTypeCode] [int] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[SourceCodeKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [PK_AppealParticipation] PRIMARY KEY CLUSTERED ([AppealParticipationKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_AppealKey] ON [dbo].[AppealParticipation] ([AppealKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_CreatedByUserKey] ON [dbo].[AppealParticipation] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_RespondentUserKey] ON [dbo].[AppealParticipation] ([RespondentUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_ResponseTypeCode] ON [dbo].[AppealParticipation] ([ResponseTypeCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_SolicitationKey] ON [dbo].[AppealParticipation] ([SolicitationKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_SourceCodeKey] ON [dbo].[AppealParticipation] ([SourceCodeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_AppealParticipation_UpdatedByUserKey] ON [dbo].[AppealParticipation] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_AppealMain] FOREIGN KEY ([AppealKey]) REFERENCES [dbo].[AppealMain] ([AppealKey]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_ResponseTypeRef] FOREIGN KEY ([ResponseTypeCode]) REFERENCES [dbo].[ResponseTypeRef] ([ResponseTypeCode])
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_SolicitationMain] FOREIGN KEY ([SolicitationKey]) REFERENCES [dbo].[SolicitationMain] ([SolicitationKey])
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_SourceCode] FOREIGN KEY ([SourceCodeKey]) REFERENCES [dbo].[SourceCode] ([SourceCodeKey])
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[AppealParticipation] ADD CONSTRAINT [FK_AppealParticipation_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO